package com.answer.handler;

import com.answer.excepction.BaseException;
import com.answer.model.reslut.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
    @ExceptionHandler
    public Result BaseExceptionHandler(BaseException e){
        return Result.faile(e.getMessage());
    }

}
